<?php
 /**
  * Bootstrap:
  * 
  * @author: Johan <info@johandahlberg.com>
  */

 /*** include the Controller class ***/
 include __APP_PATH . '/core/' . 'Controller_base.class.php';

 /*** include the Registry class ***/
 include __APP_PATH . '/core/' . 'Registry.class.php';

 /*** include the Router class ***/
 include __APP_PATH . '/core/' . 'Router.class.php';

 /*** include the Template class ***/
 include __APP_PATH . '/core/' . 'Template.class.php';

 /*** auto load model classes ***/
 function __autoload($class_name) {
    $filename = $class_name . '.class.php';
    $file = __APP_PATH . '/model/' . $filename;

    if (file_exists($file) == false) {
        return false;
    }
    include ($file);
 }

 /*** a new registry object ***/
 $registry = new Registry;
 
 /**
  * Settings environment mode variable
  * debug/staging/production
  */
 $registry->__set('environment_mode', 'debug');
 
 /**
  * Load settings so that we can access template folder
  */

 /*** create the database registry object ***/
 //$registry->db = db::getInstance();
?>